package com.dyh.quickdemo.tools.a1;

import com.alibaba.fastjson.JSON;

import java.io.*;

/*
@Author=Joey Wheeler
@Date=2020/10/31 20:17
*/
public class FileHandler {
    public static void main(String[] args) throws IOException {

        String inPath =
                "D:\\work\\dyh\\quick-demo\\src\\main\\java\\com\\dyh\\quickdemo\\tools\\a1\\in.txt"
                ;
        String outPath =
                "D:\\work\\dyh\\quick-demo\\src\\main\\java\\com\\dyh\\quickdemo\\tools\\a1\\out.txt";


        FileInputStream fileInputStream = new FileInputStream(inPath);
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream));
        FileWriter fileWriter = new FileWriter(outPath);
        BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);

        String line = null;
        while ((line = bufferedReader.readLine()) != null) {
            String[]splRes  = line.split("=");//可以切空格和tab
            String str = splRes[1];
            str = str.replace("\"","");
            bufferedWriter.write(str+"\n");
        }

        bufferedWriter.flush();
        fileInputStream.close();
    }
}
